package chapter8.test.no1;

public class Main {
	public static void main(String[] args) {
		A a=new B();
		a=new C();
		D d=new D();
	}
}
abstract class A{
	abstract void f();
}
class B extends A{
	B(){
		f();
	}
	@Override
	void f() {
		System.out.println("f:B");
	}
	public interface Y{
		int fA();
	}
}
class C extends A {
	@Override
	void f() {
		System.out.println("f:C");
	}
	C(){
		f();
	}
	 interface Z extends B.Y{
		double pi=Math.PI;
		void fZ();
	}
}
class D implements C.Z{
	@Override
	public int fA() {
		return 0;
	}

	public void fZ(){
		System.out.println(pi);
	}
	D(){fZ();
		System.out.println(fA());}
}



